package com.sinosun.autotestmachine.tools.Collector;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class FileCancelCollector extends BaseCollector {
	private Map<String, Boolean> transactionIDSet = null;
	private int cancelPoint = -1;
	
	public FileCancelCollector() {
		super();
		transactionIDSet = new ConcurrentHashMap<String, Boolean>();
		cancelPoint = 0;
	}
	
	public void putTrasactionId(String trasactionId, boolean flag) {
		transactionIDSet.put(trasactionId, flag);
	}
	
	public boolean getFlagByTrasactionId(String trasactionId) {
		return transactionIDSet.get(trasactionId);
	}
	
	public void removeTrasactionFromSet(String trasactionId) {
		transactionIDSet.remove(trasactionId);
	}
	
	public boolean containTrasactionId(String trasactionId) {
		return transactionIDSet.containsKey(trasactionId);
	}
	
	public int getSizeOfSet() {
		return transactionIDSet.size();
	}
	
	public int getCancelPoint() {
		return this.cancelPoint;
	}
	
	public void setCancelPoint(int cancelPoint) {
		this.cancelPoint = cancelPoint;
	}
}
